﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SQLite;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using DevExpress.XtraScheduler.Forms;
using TM.Data;
using TM.Data.Contracts;
using TM.DataAccessor;
using TM.ExceptionManager;
using TM.Model;

namespace TM.Test
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            InitializeCulture();

            //IDataAccessor dataAccessor = new SQLiteDataAccessor(new System.Data.SQLite.SQLiteCommand(),
            //    new SQLiteConnection(ConfigurationManager.ConnectionStrings["SQLiteConnection"].ConnectionString));

            //IProjectRepository projectRepository =
            //    (IProjectRepository)RepositoryFactories.GetRepository<Project>(new IoCParams());

            //var products = projectRepository.GetAll();
            //var count = products.Count();
            //var firstItem = products.First();
            //Console.WriteLine("Products count: " + count + " pName = " + firstItem.Name + " created date = " + firstItem.CreatedDate.ToShortDateString());
            //Console.ReadKey();
        }

        private static void InitializeCulture()
        {
            CultureInfo CI = new CultureInfo("en-US");
            CI.DateTimeFormat.LongTimePattern = "yyyy-MM-dd";

            Thread.CurrentThread.CurrentCulture = CI;
            Thread.CurrentThread.CurrentUICulture = CI;
        }
    }
}
